package com.example.demo.feign;

import com.example.demo.fallback.OrderServiceFallbackFactory;
import com.example.demo.web.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name="order-service", fallbackFactory = OrderServiceFallbackFactory.class)
public interface OrderService {

    @PostMapping(path = "/order")
    AjaxResult order(@RequestParam("userId") String userId,
                     @RequestParam("commodityCode") String commodityCode,
                     @RequestParam("orderCount") int orderCount);

}
